<template>
	<view class="content">
<!-- 		<div>
			<span>kkkk</span>
		</div> -->
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<button @click="inc">+</button>
		<view class="">{{num}}{{myStr}}</view>
		<button type="default" @click="choose">选择图片</button>
		<button type="primary" open-type="getUserInfo" @getuserinfo="getUser">授权</button>
		
		<image :src="user.avatarUrl" mode="widthFix"></image>
		
		<navigator url="../mine/mine?from=首页">调到我的</navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				num: 10,
				user:{}
			}
		},
		onLoad() {

		},
		computed: {
			myStr(){
				return this.num > 18 ? 'person' : 'kid'
			}
		},
		methods: {
			inc(){
				this.num++
			},
			choose(){
				// console.log(111)
				uni.chooseImage({
					success: (res) => {
						console.log(res)
					}
				})
			},
			getUser(e){
				this.user=e.detail.userInfo
				console.log(e.detail.userInfo)
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
